<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>系统后台 - Tpcms内容管理系统 - by Tpcms</title>
<?php if(CONTROLLER_NAME == "Login"): ?><link rel="stylesheet" type="text/css" href="/Data/Public/admin/css/admin_login.css"  />
<link rel="stylesheet" type="text/css" href="/Data/Public/admin/css/admin_default_color.css" />
<?php else: ?>
<link href="/Data/Public/admin/css/admin_style.css" rel="stylesheet" />
<link href="/Data/Public/org/artDialog/skins/default.css" rel="stylesheet" /><?php endif; ?>

<script type='text/javascript'>
MODULE='/index.php/Admin'; //当前模块
CONTROLLER='/index.php/Admin/Article'; //当前控制器)
ACTION='/index.php/Admin/Article/edit';//当前方法(方法)
ROOT=''; //当前项目根路径
PUBLIC= '/Data/Public/admin';//当前定义的Public目录
</script>
<script src="/Data/Public/org/wind.js"></script>
<script src="/Data/Public/org/jquery.js"></script>
</head>
<body class="J_scroll_fixed">
<style>
.pop_nav{
	padding: 0px;
}
.pop_nav ul{
	border-bottom:1px solid #266AAE;
	padding:0 5px;
	height:25px;
	clear:both;
}
.pop_nav ul li.current a{
	border:1px solid #266AAE;
	border-bottom:0 none;
	color:#333;
	font-weight:700;
	background:#F3F3F3;
	position:relative;
	border-radius:2px;
	margin-bottom:-1px;
}

</style>
<div class="wrap J_check_wrap">
  <div class="nav">
    <ul class="cc">
  	 <?php if($cat["cat_type"] == 4): ?><li  class="current"><a href="javascirpt:;"><?php echo ($cat["cname"]); ?>编辑文档</a></li>
      <?php else: ?>
      <li ><a href="<?php echo U('Article/index',array('category_cid'=>$_GET["category_cid"],'verifystate'=>2));?>"><?php echo ($cat["cname"]); ?>列表</a></li>
        <li class="current"><a href="javascrip:;">编辑文档</a></li><?php endif; ?>
	
      </ul>
	</div>
  <div class="pop_nav">
    <ul class="J_tabs_nav">
      <li class="current"><a href="javascript:;;">基本属性</a></li>
      <li class=""><a href="javascript:;;">图集</a></li>
      <li class=""><a href="javascript:;">其他设置</a></li>
    </ul>
  </div>
  <form class="J_ajaxForms" name="myform" id="myform" action="<?php echo U('Article/edit');?>" method="post">
    <div class="J_tabs_contents">
      <div>
        <div class="h_a">基本属性</div>
        <div class="table_full">
          <table width="100%" class="table_form ">
            <tr>
              <th  width="160">所属栏目：</th>
              <td>
               <select  name="category_cid">
                  <option value="<?php echo ($topCat["cid"]); ?>"><?php echo ($topCat["cname"]); ?></option>
                  <?php if(is_array($topChild)): foreach($topChild as $key=>$v): ?><option value="<?php echo ($v["cid"]); ?>" <?php if($_GET['category_cid'] == $v['cid']): ?>selected='selected'<?php endif; ?> >--<?php echo ($v["_html"]); echo ($v["cname"]); ?></option><?php endforeach; endif; ?>
                </select>
              </td>
            </tr>
             
           
           
            
            <tr id="normal_add">
              <th>标题：</th>
              <td><span class="must_red">*</span><input type="text" name="article_title" id="article_title" class="input" style='width:50%' value="<?php echo ($data["article_title"]); ?>"></td>
            </tr>
            <?php if(C("cfg_language_en")): ?><tr>
                <th>(英)标题：</th>
                <td><input type="text" name="article_title_en" id="article_title_en" class="input" value="<?php echo ($data["article_title_en"]); ?>" style='width:50%' ></td>
              </tr><?php endif; ?>

            <tr>
              <th ><strong>META Keywords(关键词)</strong><br/>
                关键字中间用半角逗号隔开</th>
              <td><textarea name='keywords' id='keywords' style="width:90%;height:80px"><?php echo ($data["keywords"]); ?></textarea></td>
            </tr>
            <?php if(C("cfg_language_en")): ?><tr>
              <th >(英)<strong>META Keywords(关键词)</strong><br/>
                关键字中间用半角逗号隔开</th>
              <td><textarea name='keywords_en' id='keywords_en' style="width:90%;height:80px"><?php echo ($data["keywords_en"]); ?></textarea></td>
            </tr><?php endif; ?>
            <tr>
              <th ><strong>META Description(描述)</strong><br/>
                针对搜索引擎设置的网页描述</th>
              <td><textarea name='description' id='description' style="width:90%;height:80px"><?php echo ($data["description"]); ?></textarea></td>
            </tr>
            <?php if(C("cfg_language_en")): ?><tr>
              <th >(英)<strong>META Description(描述)</strong><br/>
                针对搜索引擎设置的网页描述</th>
              <td><textarea name='description_en' id='description_en' style="width:90%;height:80px"><?php echo ($data["description_en"]); ?></textarea></td>
            </tr><?php endif; ?>
            <tr>
              <th>显示排序：</th>
              <td><input type="text" name="sort" id="sort" class="input" value="<?php echo ($data["sort"]); ?>"></td>
            </tr>
            <tr>
              <th>浏览次数：</th>
              <td><input type="text" name="click" id="click" class="input" value="<?php echo ($data["sort"]); ?>"></td>
            </tr>
            <tr>
              <th>发布时间：</th>
              <td><input type="text" name="addtime" id="addtime" class="input J_date" value="<?php echo (format_date($data["addtime"],0)); ?>"></td>
            </tr>
            <tr>
              <th>文档属性：</th>
              <td>
               <?php if(is_array(C("flag"))): foreach(C("flag") as $key=>$v): ?><label><input type="checkbox" value="<?php echo ($v); ?>" name="flag[]" <?php if(strchr($data["flag"],$v)): ?>checked='checked'<?php endif; ?>><span><?php echo ($v); ?></span></label>&nbsp;<?php endforeach; endif; ?>
             

              </td>
            </tr>
            <tr>
              <th>状态：</th>
              <td>
                <label><input type="radio" value="1" name="verifystate" <?php if($data["verifystate"] == 1): ?>checked='checked'<?php endif; ?>><span>未审核</span></label>&nbsp;
                <label><input type="radio" value="2" name="verifystate" <?php if($data["verifystate"] == 2): ?>checked='checked'<?php endif; ?>><span>通过</span></label>&nbsp;
               

              </td>
            </tr>
           
            <tr>
              <th>缩略图：</th>
              <td>
              <input type="text" name="pic" id="pic" value="<?php echo ($data["pic"]); ?>" size="50" class="input"  ondblclick="image_priview(this.value);"/> 
              <input type="button" class="button" onclick="javascript:flashupload('image_images', '附件上传','pic',submit_images,'<?php echo (CONTROLLER_NAME); ?>',1,1,'<?php echo (C("cfg_image")); ?>')" value="上传图片" /><span class="gray"> 双击可以查看图片！</span>
              </td>
            </tr>
            <tr>
              <th>文件：</th>
              <td>
              <input type="text" name="file" id="file" value="<?php echo ($data["file"]); ?>" size="50" class="input"  ondblclick="image_priview(this.value);"/> 
              <input type="button" class="button" onclick="javascript:flashupload('image_images', '附件上传','file',submit_attachment,'<?php echo (CONTROLLER_NAME); ?>',1,0,'<?php echo (C("cfg_file")); ?>')" value="上传文件" />
              </td>
            </tr>

          
            <?php if(is_array($extForm)): $i = 0; $__LIST__ = $extForm;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($i % 2 );++$i;?><tr>
	              <th><?php echo ($value["title"]); ?>：</th>
	              <td><?php echo ($value["html"]); ?></td>
	            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
           </table>
            <?php if($attrForm): ?><div class="h_a">筛选</div>
            <table width="100%" class="table_form ">
           
            <?php if(is_array($attrForm)): $i = 0; $__LIST__ = $attrForm;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($i % 2 );++$i;?><tr>
	              <th width="160"><?php echo ($value["title"]); ?>：</th>
	              <td><?php echo ($value["html"]); ?></td>
	            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
             </table><?php endif; ?>
        </div>
      </div>
      <div style="display:none">
        <div class="h_a">图集</div>
        <div class="table_full">
          <table width="100%" class="table_form ">
            <?php if($pics): if(is_array($pics)): $i = 0; $__LIST__ = $pics;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$value): $mod = ($i % 2 );++$i;?><tr rel='<?php echo ($key); ?>'>
              <th width="30">
                <?php if(!$key): ?><span class="hand plus_pics">[+]</span>
                <?php else: ?>
                  <span class="hand min_pics">[-]</span><?php endif; ?>

              </th>
              <td>
                  <input type="hidden" name="ids[]" value="<?php echo ($value["id"]); ?>"/>
                    <input type="text" name="pics[]" id="pics<?php echo ($key); ?>" value="<?php echo ($value["big"]); ?>" size="50" class="input"  ondblclick="image_priview(this.value);"/> 
                    <input type="button" class="button" onclick="javascript:flashupload('image_images', '附件上传','pics<?php echo ($key); ?>',submit_images,'<?php echo (CONTROLLER_NAME); ?>',1,1,'<?php echo (C("cfg_image")); ?>')" value="上传图片" /><span class="gray"> 双击可以查看图片！</span>
                    <input type="text" name="psort[]"  value="<?php echo ($value["sort"]); ?>" class="input" style="width:50px">
            
              </td>
            </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            <?php else: ?>
            <tr rel='0'>
              <th width="160" ><span class="hand plus_pics">[+]</span></th>
              <td>
                  <input type="text" name="pics[]" id="pics0" value="" size="50" class="input"  ondblclick="image_priview(this.value);"/> 
                  <input type="button" class="button" onclick="javascript:flashupload('image_images', '附件上传','pics0',submit_images,'<?php echo (CONTROLLER_NAME); ?>',1,1,'<?php echo (C("cfg_image")); ?>')" value="上传图片" /><span class="gray"> 双击可以查看图片！</span>
                   <input type="text" name="psort[]"  value="100" class="input" style="width:50px">
              </td>
            </tr><?php endif; ?>
            
          </table>
        </div>
      </div>



      <div style="display:none">
        <div class="h_a">其他设置</div>
        <div class="table_full">
         <table width="100%" class="table_form ">
           <tr>
             <th width="160">自定义文件：</th>
             <td><input type="text" name="file_url" id="file_url" class="input" value="<?php echo ($data["file_url"]); ?>" style="width:60%"></td>
           </tr>
           <tr>
             <th>跳转地址：</th>
             <td><input type="text" name="jump_url" id="jump_url" class="input" value="<?php echo ($data["jump_url"]); ?>" style="width:60%"></td>
           </tr>
         </table>
        </div>
      </div>
    </div> 
   
 
    <div class="btn_wrap">
      <div class="btn_wrap_pd">
        <input type="hidden" name="aid" value="<?php echo ($data["aid"]); ?>" />
        <input type="hidden" name="isattr" value="0" />
        <button class="btn btn_submit mr10 " type="submit">编辑</button>
      </div>
    </div>
  </form>
</div>
<script type="text/javascript" >
  var articleValidate = '{<?php echo ($validate); ?>}';
  var controller = '<?php echo (CONTROLLER_NAME); ?>';
  var imgextsion = '<?php echo (C("cfg_image")); ?>';
</script>
<script type="text/javascript" src="/Data/Public/admin/js/mod.common.js"></script>
<script type="text/javascript" src="/Data/Public/admin/js/mod.content_addtop.js"></script>
<script type="text/javascript" src="/Data/Public/admin/js/mod.article.js"></script>
</body>
</html>